﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml;

namespace Reborn_WorldServer.App1AppHandler
{
    public class WeaponSkill
    {
        public int ID_DB = -1;
        public string Name = "";
        public string Description = "";
        public string Skill = "";
        public int LevelRequired = 1;
        public int Cost = 0;

        public string toXML()
        {
            string result = "";

            StringWriter stringWriter = new StringWriter();
            XmlTextWriter xmldoc = new XmlTextWriter(stringWriter);

            xmldoc.WriteStartElement("weaponskill");
            xmldoc.WriteAttributeString("ID_DB", ID_DB.ToString());
            xmldoc.WriteAttributeString("Name", Name.ToString());
            xmldoc.WriteAttributeString("Description", Description.ToString());
            xmldoc.WriteAttributeString("Skill", Skill);
            xmldoc.WriteAttributeString("LevelRequired", LevelRequired.ToString());
            xmldoc.WriteAttributeString("Cost", Cost.ToString());

            xmldoc.WriteEndElement();
            xmldoc.Flush();

            xmldoc.Close();

            stringWriter.Flush();

            result = stringWriter.ToString();

            return result;
        }
    }
}
